<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *模板管理
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get'){
	$item=$this->plugin_setting('setting');
	$item['regbg']=$item['regbg']?:'../addons/jy_weishop/resource/images/myshoptop.jpg';
	$return['item']=$item;
	$htmls[]=array(
		'type'=>'look',
		'width'=>'350px',
		'flex'=>1,
		'look'=>array(
			array('type'=>'diyform','name'=>'diyformfields','title'=>'申请商户'),
		),
	);
	$htmls[]=array(
		'type'=>'edit',
		'post'=>'post',
		'edit'=>array(
			array('type'=>'tip','title'=>'【温馨提示】：前端效果：商户名称，主营项目，商户分类，简单介绍等默认显示最上面！这里就不重复显示了！'),
			array('type'=>'image','title'=>'TOP图','name'=>'regbg','help'=>''),
			array(
							'type'=>'array',
							'name'=>'diyformfields',
							'title'=>'自定义表单项',
							'add_tip'=>'添加自定义表单项',
								'list'=>array(
									array('type'=>'string','name'=>'title','title'=>'标题','help'=>''),
									array('type'=>'radio','name'=>'type','title'=>'类型','options'=>'types'),
									array('type'=>'string','name'=>'placeholder','title'=>'提示语'),
									array('type'=>'switch','name'=>'ismust','title'=>'*必填?'),
								),
								'details'=>array(
									array('type'=>'string','name'=>'title','title'=>'标题','help'=>''),
									array('type'=>'radio','name'=>'type','title'=>'类型','options'=>'types'),
									array(
											'type'=>'array_simple',
											'show'=>array('type'=>array(4,5,19)),
											'name'=>'value',
											'add_tip'=>'添加自定义表单项',
												'fields'=>array(
													array('type'=>'string','name'=>'title','title'=>'选项名称','help'=>''),
												),
									),
									array('type'=>'string','name'=>'placeholder','title'=>'提示语'),
									array('type'=>'switch','name'=>'ismust','title'=>'*必填?'),
								)
			),
					
		)
	);
	$return['types']=get_form_types();
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$this->plugin_setting('setting',$postdata);
	exi('设置成功');
}